package com.gome.ocean.common.enums;

/**
 * 分表顺序
 * 
 * @author haqiaolong 2016年7月25日 上午11:05:16
 * @since 5.0.0
 */
public enum ShardOrder {

    RANDOM(0), ORDER(1);

    private int value;

    private ShardOrder(int value){
        this.value = value;
    }

    public static ShardOrder getShardOrder(int value) {
        for (ShardOrder shardOrder : ShardOrder.values()) {
            if (shardOrder.getValue() == value) {
                return shardOrder;
            }
        }
        return null;
    }

    public int getValue() {
        return value;
    }
}
